import { Vector3 } from '@babylonjs/core/Maths/math.vector';
import { DefaultStage } from '../default-stage';
import { HavokPlugin } from '@babylonjs/core/Physics/v2/Plugins/havokPlugin';
import HavokPhysics from '@babylonjs/havok';
import '@babylonjs/core/Physics/physicsEngineComponent';
import { PhysicsAggregate } from '@babylonjs/core/Physics/v2/physicsAggregate';
import { PhysicsViewer } from '@babylonjs/core/Debug/physicsViewer';


class PhysicsManager {

    private static _stage: DefaultStage;
    private static _viewer: PhysicsViewer;

    public static youxieban: PhysicsAggregate;
    public static zuoxieban: PhysicsAggregate;
    public static youqiu: PhysicsAggregate;
    public static zuoqiu: PhysicsAggregate;
    public static youlifangti: PhysicsAggregate;
    public static zuolifangti: PhysicsAggregate;
    public static youliulengzhu: PhysicsAggregate;
    public static zuoliulengzhu: PhysicsAggregate;

    public static async initialize(stage: DefaultStage): Promise<void> {
        this._stage = stage;
        const hk = await HavokPhysics();
        const plugin = new HavokPlugin(true, hk);
        stage.mainScene.enablePhysics(new Vector3(0, 0, 0), plugin);
        this._viewer = new PhysicsViewer(stage.mainScene);
        this.initializeRigid(stage);
    }

    private static initializeRigid(stage: DefaultStage): void {
        
    }

}


export { PhysicsManager };